﻿using GameCreator.Camera;
using GameCreator.Core.Hooks;
using GameCreator.Messages;
using Gp.Scripts.Core;
using Gp.Scripts.Core.Command;
using QFramework;
using UnityEngine;
using IAction = GameCreator.Core.IAction;

namespace Gp.GCX {
    /// <summary>
    /// 进入检查模式
    /// </summary>
    [AddComponentMenu("")]
    public class EnterDetailModeAc : ActionCameraChange {
        public override bool InstantExecute(GameObject target, IAction[] actions, int index, params object[] parameters) {
            // InputLayerSystem.Instance.SwitchLayer(InputLayer.Detail);
            return base.InstantExecute(target, actions, index);
        }
        
        
#if UNITY_EDITOR
        public new static string NAME = "Gp/检查模式/进入检查模式";
        private const string NODE_TITLE = "进入检查模式";




        public override string GetNodeTitle() {
            return NODE_TITLE;
        }
#endif
    }
    
    [AddComponentMenu("")]
    public class ExitDetailModeAc : IAction, ICanSendCommand {
#if UNITY_EDITOR
        public new static string NAME = "Gp/检查模式/退出检查模式";
        private const string NODE_TITLE = "退出检查模式";
        [Range(0, 0.5f)] public float transitionTime = 0.2f;

        public override bool InstantExecute(GameObject target, IAction[] actions, int index) {
            this.SendCommand(new ExitDetailModeCommand(transitionTime));
            return true;
        }

        public override string GetNodeTitle() {
            return NODE_TITLE;
        }
#endif
        public IArchitecture GetArchitecture() {
            return MainArchitecture.Interface;
        }
    }
}